home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / SPX30.ZIP / SPX_DOC.ZIP / SPX_VGA.DOC < prev    next >
Encoding:
Text File  |  1994-06-13  |  20.2 KB  |  660 lines

  1. { SPX Library Version 3.0  Copyright 1993 Scott D. Ramsay }
  2.  
  3.  SPX_VGA  is the main graphics kernel.  All the graphic primitives
  4. are here.
  5.  
  6. ───────────────────────────────────────────────────────────────────────────
  7. procedure VSinc;
  8.  
  9.   Waits for a vertical retrace to occur.
  10.  
  11. ───────────────────────────────────────────────────────────────────────────
  12. procedure setclip(x1,y1,x2,y2:integer);
  13.  
  14.   Sets the clipping region.
  15.  
  16.   (WinMinX,WinMinY) - (WinMaxX,WinMaxY)
  17. ───────────────────────────────────────────────────────────────────────────
  18. procedure resetclip;
  19.  
  20.   Resets the clipping region to the size of the screen.
  21.  
  22. ───────────────────────────────────────────────────────────────────────────
  23. procedure translatebox(x1,y1,x2,y2:integer;var table);
  24.  
  25.    Draws a box using a translation table.
  26.  
  27.    X1,Y1:  Top-left coordinate of the region;
  28.    X2,Y2:  Bottom-right coordinate of the region;
  29.    table:  Must be of size 256 bytes:  { array[0..255] of byte }
  30.  
  31.    The pixels color within the box becomes an index to the table.  The
  32.    value in the table becomes the color displayed.
  33.  
  34.    e.g.
  35.  
  36.    var
  37.      i : integer;
  38.      table : array[0..255] of byte;
  39.    begin
  40.       for i := 0 to 255 do
  41.         table[i] := i;
  42.       table[40] := 2;
  43.  
  44.       translatebox(100,100,110,110,table);
  45.    end;
  46.  
  47.    The above example will change only the color 40 in the region to
  48.    color 2.
  49. ───────────────────────────────────────────────────────────────────────────
  50. procedure LightColor(var color:RGBtype;percent:byte);
  51.  
  52.   Brightens the palette type by a percentage.
  53.  
  54.   LightColor(color,100);  { changes the color to pure white }
  55.   LightColor(color,50);   { changes the color to 50% brighter }
  56.  
  57. ───────────────────────────────────────────────────────────────────────────
  58. procedure DarkColor(var color:RGBtype;percent:byte);
  59.  
  60.   Darkens the palette type by a percentage.
  61.  
  62.   LightColor(color,100);  { changes the color to pure black }
  63.   LightColor(color,50);   { changes the color to 50% darker }
  64.  
  65. ───────────────────────────────────────────────────────────────────────────
  66. procedure CreateDarkTable(var colors;var dktable;percent:integer);
  67.  
  68.   Creates a Darkening Table. Does not change the palette just a translation
  69.   table.
  70.  
  71.   colors  : RGBlist type to darken
  72.   dktable : array[0..255] of byte; will contain the darkening table
  73.   perenct : percentage to darken
  74.  
  75.   Creates a translation table with the passed in palette tries to find
  76.   a corresponding dark color.
  77.  
  78.   Use with translatebox, fxtput_clip
  79.  
  80. ───────────────────────────────────────────────────────────────────────────
  81. procedure CreateLightTable(var colors;var ltable;percent:integer);
  82.  
  83.   Creates a light table. Does not change the palette just a translation
  84.   table.
  85.  
  86.   colors  : RGBlist type to brighten. (Does not change the palette)
  87.   ltable  : array[0..255] of byte; will contain the light table
  88.   perenct : percentage to brighten
  89.  
  90.   Creates a translation table with the passed in palette tries to find
  91.   a corresponding light color.
  92.  
  93.   Use with translatebox, fxtput_clip
  94.  
  95. ───────────────────────────────────────────────────────────────────────────
  96. procedure SetDefaultColors;
  97.  
  98.   Sets the VGA palette to the default SPX library colors.
  99.  
  100. ───────────────────────────────────────────────────────────────────────────
  101. procedure Switch(var a,b:integer);
  102.  
  103.   Exchanges the values of A and B.
  104.  
  105. ───────────────────────────────────────────────────────────────────────────
  106. procedure Parse(var x,y:integer);
  107.  
  108.   Clips the point (x,y). to the legal range.
  109.  
  110.     X:  Column coordinate 0..319;
  111.     Y:  Row coordinate 0..199
  112.  
  113. ───────────────────────────────────────────────────────────────────────────
  114. function BuffSize(x,y:integer):word;
  115.  
  116.   Returns the size of the buffer needed for a sprite size of (x,y).
  117.  
  118.   X:  Width of the sprite;
  119.   Y:  Height of the sprite
  120.  
  121. ───────────────────────────────────────────────────────────────────────────
  122. function ImageSize(var image):word;
  123.  
  124.   Returns the size of the memory used by the sprite.
  125.  
  126.   IMAGE: Sprite
  127.  
  128. ───────────────────────────────────────────────────────────────────────────
  129. procedure ImageDims(var image;var x,y:integer);
  130.  
  131.   Returns the width and height of a sprite.
  132.  
  133.   IMAGE: Sprite;
  134.   X:     Width of the sprite;
  135.   Y:     Height of the sprite
  136.  
  137. ───────────────────────────────────────────────────────────────────────────
  138. procedure SetPtr(var i:PtrRec;var buff);
  139.  
  140.   Returns a PtrRec  (Segment:offset) of a given buffer.
  141.  
  142.   I:      Returning record;
  143.   BUFF:   Any memory buffer or variable
  144.  
  145. ───────────────────────────────────────────────────────────────────────────
  146. function pt(x,y:integer):word;
  147.  
  148.   Returns the offset of the location (x,y).
  149.  
  150.   X:   Column position;
  151.   Y:   Row position
  152.  
  153. ───────────────────────────────────────────────────────────────────────────
  154. procedure OpenMode(npages:byte);
  155.  
  156.   Sets the VGA to 320x200x256 mode and allocates virtual pages.
  157.  
  158.   NPAGES:  Number of pages to use
  159.  
  160.   NOTE:  Page 1 is always the visual page.  Pages 2..n are created
  161.          dynamically on the heap.
  162.  
  163. ───────────────────────────────────────────────────────────────────────────
  164. function Point(x,y:integer;pg:byte):byte;
  165.  
  166.   Returns the color value of a location on a page.
  167.  
  168.   X:   Column position;
  169.   Y:   Row position;
  170.   PG:  Page to retrieve the color
  171.  
  172. ───────────────────────────────────────────────────────────────────────────
  173. procedure Pset(x,y:integer;n:byte);
  174.  
  175.   Draw a point onto the active page.
  176.  
  177.   X:   Column position;
  178.   Y:   Row position;
  179.   n:   Color
  180.  
  181. ───────────────────────────────────────────────────────────────────────────
  182. procedure fPcopy(var from,too);
  183.  
  184.   Copies one page to another.
  185.  
  186.   FROM:  Buffer location of the source page;
  187.   TOO:   Buffer location of the destination page
  188.  
  189.   NOTE:  If 386 or later processor is present, 386 copies will be used.
  190.  
  191. ───────────────────────────────────────────────────────────────────────────
  192. procedure Pcopy(from,too:byte);
  193.  
  194.   Same as fPcopy, copies only predefined virtual pages.
  195.  
  196.   FROM:  Page number of the source page;
  197.   TOO:   Page number of the destination page
  198.  
  199. ───────────────────────────────────────────────────────────────────────────
  200. procedure CopyRect(x1,y1,x2,y2:integer;var from,too);
  201.  
  202.   Copy a rectangular region from one page to another.
  203.  
  204.   X1,Y1:  Top-left coordinate of the region;
  205.   X2,Y2:  Bottom-right coordinate of the region;
  206.   FROM:   Buffer location of the source page;
  207.   TOO:    Buffer location of the destination page
  208.  
  209.   EXAMPLE:
  210.  
  211.       CopyRect(100,100,200,140,pages[2]^,pages[1]^);
  212.  
  213.       Copies a region on page 2 to the visual page.
  214.  
  215. ───────────────────────────────────────────────────────────────────────────
  216. procedure fwCopyRect(x1,y1,x2,y2:integer;var from,too);
  217.  
  218.   Same as CopyRect.  Forces even amount width moves.
  219.  
  220.   X1,Y1:  Top-left coordinate of the region;
  221.   X2,Y2:  Bottom-right coordinate of the region;
  222.   FROM:   Buffer location of the source page;
  223.   TOO:    Buffer location of the destination page
  224.  
  225.   NOTE: Make sure that (X2-X1+1) is an even number. Unpredictable results
  226.    will happen if the source and destination page are the same.
  227.  
  228. ───────────────────────────────────────────────────────────────────────────
  229. procedure SwapRect(x1,y1,x2,y2:integer;from,too:byte);
  230.  
  231.   Exchange regions from two pages.
  232.  
  233.   X1,Y1:  Top-left coordinate of the region;
  234.   X2,Y2:  Bottom-right coordinate of the region;
  235.   FROM:   Page number of the source page;
  236.   TOO:    Page number of the destination page
  237.  
  238.   NOTE:  Unpredictable results will happen if the source and destination
  239.        page are the same.
  240.  
  241. ───────────────────────────────────────────────────────────────────────────
  242. procedure Line_clip(x1,y1,x2,y2:integer;n:byte);
  243.  
  244.   Draws a line on the active page.  Clips the line according to
  245.   WinMinX, WinMinY, WinMaxX, WinMaxY.
  246.  
  247.   X1,Y1:  Coordinate one of the line;
  248.   X2,Y2:  Coordinate two of the line;
  249.   n:      Color of line
  250.  
  251. ───────────────────────────────────────────────────────────────────────────
  252. procedure Line(x1,y1,x2,y2:integer;n:byte);
  253.  
  254.   Draw a line on the active page.  DOES NOT preform any clipping.  Faster
  255.   than the Line_clip procedure.
  256.  
  257.   X1,Y1:  Coordinate one of the line;
  258.   X2,Y2:  Coordinate two of the line;
  259.   n:      Color of line
  260.  
  261. ───────────────────────────────────────────────────────────────────────────
  262. procedure Bar(x1,y1,x2,y2:integer;n:byte);
  263.  
  264.   Draws a filled rectangle on the active page.
  265.  
  266.   X1,Y1:  Coordinate one of the bar;
  267.   X2,Y2:  Coordinate two of the bar;
  268.   n:      Color of bar
  269.  
  270. ───────────────────────────────────────────────────────────────────────────
  271. procedure Rectangle(x1,y1,x2,y2:integer;n:byte);
  272.  
  273.   Draws a rectangle on the active page.
  274.  
  275.   X1,Y1:  Coordinate one of the rectangle;
  276.   X2,Y2:  Coordinate two of the rectangle;
  277.   n:      Color of bar
  278.  
  279. ───────────────────────────────────────────────────────────────────────────
  280. procedure Circle(x1,y1,r:integer;n:byte);
  281.  
  282.   Draws a circle on the active page.
  283.  
  284.   X1,Y1:  Center coordinate of the circle;
  285.   R:      Radius of the circle;
  286.   N:      Color of circle
  287.  
  288. ───────────────────────────────────────────────────────────────────────────
  289. procedure Ellipse(xc,yc,a0,b0:integer;c:byte);
  290.  
  291.   Draws an ellipse on the active page.
  292.  
  293.   XC,YC:  Center coordinate of the ellipse;
  294.   A0:     Height radius of ellipse;
  295.   B0:     Width radius of ellipse;
  296.   C:      Color of ellipse
  297.  
  298. ───────────────────────────────────────────────────────────────────────────
  299. procedure cls(b:byte);
  300.  
  301.   Clears the active page.
  302.  
  303.   B:  The color to clear the active page
  304.  
  305. ───────────────────────────────────────────────────────────────────────────
  306. procedure CloseMode;
  307.  
  308.   Restores the video mode and deallocates virtual pages.
  309.  
  310. ───────────────────────────────────────────────────────────────────────────
  311. procedure SetPageActive(page:byte);
  312.  
  313.   Changes the active page.
  314.  
  315.   PAGE: New page number to become active.
  316.  
  317.   NOTE:  If allocated memory for virtual page.  Use SCNSEG:SCNOFS to
  318.     change the active page.
  319.  
  320.   EXAMPLE:
  321.        var
  322.           MyVirt : pointer;
  323.           .
  324.           .
  325.           .
  326.  
  327.         Getmem(MyVirt,64000);   { Allocate a virtual page }
  328.         SetPageActive(1);       { Sets the active page to page 1 }
  329.  
  330.         SCNSEG := seg(MyVirt^); { Sets the active page to MyVirt }
  331.         SCNOFS := ofs(MyVirt^);
  332.  
  333. ───────────────────────────────────────────────────────────────────────────
  334. procedure GetColor(num:byte;var red,green,blue:byte);
  335.  
  336.    Retrieves a color from the current palette.
  337.  
  338.    NUM:    Color number;
  339.    RED:    Red componet of the color;
  340.    GREEN:  Green componet of the color;
  341.    BLUE:   Blue componet of the color
  342.  
  343. ───────────────────────────────────────────────────────────────────────────
  344. procedure SetColor(num,red,green,blue:byte);
  345.  
  346.   Sets a color of the current palette.
  347.  
  348.    NUM:    Color number;
  349.    RED:    Red componet of the color;
  350.    GREEN:  Green componet of the color;
  351.    BLUE:   Blue componet of the color
  352.  
  353. ───────────────────────────────────────────────────────────────────────────
  354. procedure fSetColors(var colors);
  355.  
  356.    Sets all the colors of the current palette.
  357.  
  358.    COLORS:  A buffer which contains a red, green and blue componet for
  359.      each of the 256 colors
  360.  
  361. ───────────────────────────────────────────────────────────────────────────
  362. procedure fGetColors(var colors);
  363.  
  364.    Retrieves all the colors from the current palette.
  365.  
  366.    COLORS:  A buffer which will contain a red, green and blue componet for
  367.      each of the 256 colors
  368.  
  369.    NOTE:  Can be used repeatedly for custom fades.  (Does not flicker)
  370.  
  371. ───────────────────────────────────────────────────────────────────────────
  372. procedure FadeIn(steps:word;var color);
  373.  
  374.    Fade the screen from black to the palette specified.
  375.  
  376.    STEPS: Speed of the fade;
  377.    COLOR: Final palette after the fade
  378.  
  379. ───────────────────────────────────────────────────────────────────────────
  380. procedure FadeOut(steps:word;var color);
  381.  
  382.    Fade the screen from palette specified to black.
  383.  
  384.    STEPS: Speed of the fade;
  385.    COLOR: Palette before the fade, (Usually is the current palette)
  386.  
  387.    EXAMPLE:
  388.  
  389.       var
  390.         Apal : RGBlist;
  391.  
  392.       fgetcolors(Apal);  { grab the current palette }
  393.       FadeOut(30,Apal);  { Fade the screen to black }
  394.  
  395. ───────────────────────────────────────────────────────────────────────────
  396. procedure ColorsChange(var color:rgblist;filter:rgbtype);
  397.  
  398.    Change the color palette using a color filter.
  399.  
  400.    COLOR:  Palette to change;
  401.    FILTER: Red, green, blue componets of the filter
  402.  
  403.    EXAMPLE:
  404.  
  405.       TanFilter : RGBtype;
  406.       Apal      : RBGlist;
  407.  
  408.       TanFilter.red := 63;
  409.       TanFilter.green := 30;
  410.       TanFilter.blue := 13;
  411.       fgetcolors(Apal);  { grab the current palette }
  412.       ChangeColors(Apal,TanFilter);
  413.       fsetcolors(Apal);  { change the palette to tan screen }
  414.  
  415. ───────────────────────────────────────────────────────────────────────────
  416. procedure ColorCycle(var colors:rgblist;start:byte;count:integer;fwd:boolean);
  417.  
  418.   Cycles a range of colors one step forward or backwards.
  419.  
  420.   COLORS:  Palette to change;
  421.   START:   Starting color index;
  422.   COUNT:   Number of colors to rotate;
  423.   FWD:     Set to TRUE to cycle forward
  424.  
  425.   EXAMPLE:
  426.  
  427.      var
  428.        Apal : RGBlist;
  429.  
  430.        fgetcolors(Apal);
  431.        repeat
  432.          ColorCycle(Apal,0,256,true);   { Cycle the entire palette }
  433.          fsetcolors(Apal);              { using fsetcolors to set the palette }
  434.        until crt.Keypressed;            { until a key is pressed }
  435.  
  436. ───────────────────────────────────────────────────────────────────────────
  437. function LoadColors(filename:string;var colors):integer;
  438.  
  439.   Load a color palette from disk.
  440.  
  441.   FILENAME:  Palette dos file name;
  442.   COLORS:    Buffer to store the palette;
  443.  
  444.   Can read raw 768 byte .pal files or Ani pro .col files
  445.  
  446. ───────────────────────────────────────────────────────────────────────────
  447. function SaveColors(filename:string;var colors;raw:boolean):integer;
  448.  
  449.   Save a color palette to disk.
  450.  
  451.   FILENAME:  Palette dos file name;
  452.   COLORS:    Palette to save;
  453.   RAW:       Set to TRUE to save as a raw 768 byte file, or FALSE
  454.              to save in an Animator Pro .COL file
  455. ───────────────────────────────────────────────────────────────────────────
  456. procedure Paint(x,y:integer;n:byte);
  457.  
  458.   Flood fills a region.
  459.  
  460.   X,Y: The location to start filling;
  461.   N:   The color to fill
  462.  
  463.   NOTE:  This procedure does not use the a border algorthim.  It fills
  464.      the area with color (n) that has the occurances of the color at
  465.      location (X,Y)
  466.  
  467. ───────────────────────────────────────────────────────────────────────────
  468. procedure CopyTo(x1,y1,x2,y2,x,y:integer;var from,too);
  469.  
  470.   Copies a region to another area.
  471.  
  472.   X1,Y1:  Top-left coordinate of the source region;
  473.   X2,Y2:  Bottom-right coordinate of the source region;
  474.   X,Y:    Top-left coordinate of the destination region;
  475.   FROM:   Buffer location of the source page;
  476.   TOO:    Buffer location of the destination page
  477.  
  478.   NOTE: Unpredictable results will happen if the source and destination page
  479.     are the same and the region overlapps.
  480.  
  481. ───────────────────────────────────────────────────────────────────────────
  482. function LoadVSP(fn:string;var buff):integer;
  483.  
  484.   Load a sprite file.
  485.  
  486.   FN:    DOS file name of the .VSP file;
  487.   BUFF:  An array of pointer to hold the sprites
  488.  
  489.   NOTE:  Buff MUST be a pointer, or an array of pointer.  And they can NOT
  490.     be preallocated.  Does not check the array is smaller that the number
  491.     of sprites in the file.  Returns the number of sprites loaded.
  492.  
  493.   EXAMPLE:
  494.  
  495.      var
  496.        asprite : pointer;
  497.        sprites : array[0..19] of pointer;
  498.        moresp  : array[0..20] of pointer;
  499.  
  500.       { below are legal statements }
  501.  
  502.        loadvsp('onevsp.vsp',asprite);
  503.        loadvsp('20vsps.vsp',sprites);
  504.        loadvsp('onevsp.vsp',moresp[10]);
  505.  
  506. ───────────────────────────────────────────────────────────────────────────
  507. function FileVSP(var fil:file;var buff;size:longint):integer;
  508.  
  509.   Loads sprites from an open file.
  510.  
  511.   FIL:   Binary file that contains sprites;
  512.   BUFF:  An array of pointer to hold the sprites;
  513.   SIZE:  Size of the sprites in the area.
  514.  
  515.   NOTE:  Does not close the file.  Returns the number of sprites loaded.
  516.     Be sure that SIZE corresponds to the exact size of the sprites to
  517.     load.
  518.  
  519. ───────────────────────────────────────────────────────────────────────────
  520. function AnalyzeScreen:byte;
  521.  
  522.   Returns the color number that is used the most on the active page.
  523.  
  524. ───────────────────────────────────────────────────────────────────────────
  525. procedure MemWrite(var source,dest;size:word;var off:longint);
  526.  
  527.   Copies data from SOURCE to DEST.
  528.  
  529.   SOURCE:  Source buffer;
  530.   DEST:    Destination buffer;
  531.   SIZE:    Number of bytes to copy;
  532.   OFF:     Offset in DEST to start the copy
  533.  
  534.   NOTE:  Upon returning  OFF = OFF+SIZE
  535.  
  536. ───────────────────────────────────────────────────────────────────────────
  537. procedure MemRead(var source,dest;size:word;var off:longint);
  538.  
  539.   Copies data from SOURCE to DEST.
  540.  
  541.   SOURCE:  Source buffer;
  542.   DEST:    Destination buffer;
  543.   SIZE:    Number of bytes to copy;
  544.   OFF:     Offset in SOURCE to start the copy
  545.  
  546.   NOTE:  Upon returning OFF = OFF+SIZE
  547.  
  548. ───────────────────────────────────────────────────────────────────────────
  549. procedure fwput(x1,y1:integer;var image);
  550.  
  551.   Displays a sprite on the active page.  Forces even amount width moves.
  552.  
  553.   X1,Y1:  Coordinate to place top-left of sprite.
  554.   IMAGE:  Sprite;
  555.  
  556. ───────────────────────────────────────────────────────────────────────────
  557. procedure moveDW(var source,dest;size:word);
  558.  
  559.   Same as Turbo Pascal's move procedure.  Uses 386 instructions.
  560.  
  561.   SOURCE: Source buffer;
  562.   DEST:   Destination buffer;
  563.   SIZE:   Size in bytes of memory to copy
  564.  
  565. ───────────────────────────────────────────────────────────────────────────
  566. procedure fputDW(x:word;var buff);
  567.  
  568.   Displays a sprite on the active page.  Forces 386 instructions.  Does
  569.    not preform any clipping.
  570.  
  571.   X:     Offset of the active page.  E.G.  = pt(x,y);
  572.   BUFF:  Sprite to display
  573.  
  574.   NOTE:  This is the fastest sprite drawing routine.  The width of the
  575.     sprite must be divisible by 4.
  576.  
  577. ───────────────────────────────────────────────────────────────────────────
  578. procedure PcopyDW(var from,too);
  579.  
  580.   Same a fPcopy.  Forces 386 instructions.  Copies one page to another.
  581.  
  582.   FROM:  Buffer location of the source page;
  583.   TOO:   Buffer location of the destination page
  584.  
  585. ───────────────────────────────────────────────────────────────────────────
  586. procedure fillDW(var dest;c:word;v:byte);
  587.  
  588.   Fills a memory region with the value V.  Forces 386 instructions.
  589.  
  590.   DEST:  The memory area to fill;
  591.   C:     Number of bytes to fill;
  592.   V:     Value to fill
  593.  
  594. ───────────────────────────────────────────────────────────────────────────
  595. procedure clsDW(c:byte);
  596.  
  597.   Same as CLS.  Clears the active page.  Forces 386 instructions.
  598.  
  599.   C:  The color to clear the active page
  600.  
  601. ───────────────────────────────────────────────────────────────────────────
  602. procedure fhLine(x1,x2,y:integer;c:byte);
  603.  
  604.   Draws a horzontal line.  Fast!
  605.  
  606.     X1,X2:  Horzontal coordinates
  607.     Y:      Vertical coordinate
  608.     C:      Color
  609.  
  610. ───────────────────────────────────────────────────────────────────────────
  611. procedure DrawPoly(offx,offy:integer;poly:Tpoly;c:byte);
  612.  
  613.   Draws a outlined polygon.
  614.  
  615.     OFFX,OFFY: Start location of polygon
  616.     POLY:      Polygon structure
  617.     C:         Color
  618.  
  619.     EXAMPLE:
  620.  
  621.     var
  622.       p : tPoly;
  623.     begin
  624.       p.init;
  625.       p.addpoint(10,10);
  626.       p.addpoint(-10,10);
  627.       p.addpoint(-10,-10);
  628.       p.addpoint(10,-10);
  629.       p.addpoint(10,10);
  630.       DrawPoly(160,100,p,15);
  631.     end;
  632.  
  633.     Draws a box of color 15
  634.  
  635. ───────────────────────────────────────────────────────────────────────────
  636. procedure FillPoly(offx,offy:integer;poly:Tpoly;c:byte);
  637.  
  638.   Draws a filled polygon.  Not the fastest.  "Its my first attempt ;)"
  639.  
  640.     OFFX,OFFY: Start location of polygon
  641.     POLY:      Polygon structure
  642.     C:         Color
  643.  
  644.     EXAMPLE:
  645.  
  646.     var
  647.       p : tPoly;
  648.     begin
  649.       p.init;
  650.       p.addpoint(10,10);
  651.       p.addpoint(-10,10);
  652.       p.addpoint(-10,-10);
  653.       p.addpoint(10,-10);
  654.       p.addpoint(10,10);
  655.       FillPoly(160,100,p,15);
  656.     end;
  657.  
  658.     Draws a filled box of color 15
  659.  
  660. ───────────────────────────────────────────────────────────────────────────